Skip to content

Conversation

@white-axe
Copy link
Contributor

@white-axe white-axe commented Apr 1, 2025

When building RetroArch for PlayStation Vita, Makefile.vita currently passes -fno-optimize-sibling-calls to the compiler to work around a bug where if sibling call optimization is enabled, the compiler may generate veneers to switch between ARM mode and Thumb mode. The veneers cause Vita SDK's tools to break -- the code will still compile, but the compiled binary crashes when executed when it tries to call a veneer.

However, according to vitasdk/buildscripts#123, it's possible to stop the veneers from breaking things by passing -Wl,--pic-veneer when linking.

This seems like a better solution than -fno-optimize-sibling-calls in my opinion because there may be other things that generate veneers than just sibling calls. In fact, I'm working on a new libretro core, and the compiler still generates veneers even when -fno-optimize-sibling-calls is enabled in both RetroArch and every single file in my core's code, so using -Wl,--pic-veneer is the only solution for me.

@LibretroAdmin LibretroAdmin merged commit 029469b into libretro:master Apr 1, 2025
31 checks passed
@white-axe white-axe deleted the vita-pic-veneer branch April 1, 2025 21:18
white-axe added a commit to white-axe/mkxp-z that referenced this pull request Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants